/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import core.IMAPMIDlet;
import javax.microedition.lcdui.Display;

/**
 *
 * @author Kvest
 */
public class BacklightHelper 
{
    public static void backlight(int duration)
    {
        try
        {
            Class.forName("com.nokia.mid.ui.DeviceControl");
            com.nokia.mid.ui.DeviceControl.setLights(0, 100);
        }
        catch(Exception e)
        {
            defaultBackLight(duration);
        }
    }
    
    private static void defaultBackLight(int duration)
    {
        Display.getDisplay(IMAPMIDlet.getMidlet()).flashBacklight(duration * 1000);
    }
}
